package com.example.project_01.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.project_01.dto.DrugDTO;
import com.example.project_01.entity.DrugEntity;
import com.example.project_01.model.DrugModel;
import com.example.project_01.pojo.Drug;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface DrugMapper extends BaseMapper<Drug> {
    //查询所有药品的同时，封装药品销售地点
    List<DrugModel> getAllDrug(String drugName);

    //新增药品信息
    int addDrug(DrugDTO drugDTO);

    //添加药品的售卖店
    int insertSalePlace(@Param("drugId") Integer drugId, @Param("saleIds") Integer[] saleIds);

    //根据药品id删除对应的售卖地点
    int deleteSaleByDrugId(@Param("drugId") Integer drugId);

    //根据id更新药店数据
    /*int updateDrugById(DrugEntity drugEntity);*/

}
